// A home class to manage the applications skeleton. I like to declare variables and create initial objects here, passing this class throughout the program.

import nme.display.MovieClip;
import nme.events.MouseEvent;
import nme.text.TextField;
import nme.text.TextFormat;

class Home extends MovieClip {
    public var span:Int;
    public var depth:Int;
    public var white:Int;
    public var black:Int;
    public var gray:Int;
    public var red:Int;
    public var yellow:Int;
    public var green:Int;
    public var blue:Int;
    public var calc:Calc;
    public var centerButton:Button;

    public function new(myCanvas:MovieClip) {
        super();

        // Declare the size of the flash object. As "width" and "height" are used, "span" and "depth" are substituted
        span = 970;
        depth = 600;

        // Declare some colors
        white = 0xFFFFFF;
        black = 0x000000;
        gray = 0x808080;
        red = 0xFF0000;
        yellow = 0xFFFF00;
        green = 0x8000;
        blue = 0x0000FF;

        // Create the calc, which contains general use functions
        calc = new Calc(this);

        // Create a button
        centerButton = new Button(this, calc.perXAbs(.5) - 50, calc.perYAbs(.5) - 50, 100, 100, blue, red, "trace something", something);

        myCanvas.addChild(this);
    } // public function new(grid:MovieClip, columnNumber:Int, rowNumber:Int)

    // Trace a string in the console. The console can be viewed by pressing the '`' key
    public function something() { trace("something"); }

} // class Button extends MovieClip
